package view;

import javax.swing.JPanel;

import util.Coord;

import controller.Controller;

import model.ModelReader;

public abstract class GamePanel extends JPanel{
	private static final long serialVersionUID = 1L;
	protected Stage parent;
	protected Controller controller;
	protected ModelReader mr;
	protected boolean needsRepaint;
	protected int HEIGHT, WIDTH;
	
	public GamePanel(Stage parent, Controller controller, int w, int h){
		this.parent = parent;
		this.controller = controller;
		this.WIDTH = w;
		this.HEIGHT = h;
		this.needsRepaint = false;
		mr = parent.getModelReader();
		setSize(WIDTH, HEIGHT);
		setFocusable(false);
		init();
	}
	
	public int getHeight(){
		return HEIGHT;
	}
	
	public int getWidth(){
		return WIDTH;
	}

	protected abstract void init();
	protected abstract void update();

	public void draw() {
		update();
	}
}
